package whu.cn.whushare.common;

import android.content.Context;

public class Application extends android.app.Application {
    @Override
    public void onCreate() {
        super.onCreate();
        //对Uncaught异常进行处理
        CrashHandler crashHandler = CrashHandler.getInstance();
        crashHandler.init(getApplicationContext());
        //设置Umeng消息推送
        UmengHandler.getInstance(getApplicationContext()).setDefaultHandler();
    }

    /**
     * 退出应用时释放必要资源
     */
    public static void release(Context context) {
        ImageWorkerManager.getInstance(context.getApplicationContext()).release();
        UmengHandler.getInstance(context).release();
    }
}
